<!--
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 * No deletion without permission, or be held responsible to law.
 * @author ThinkGem
-->
<template>
  <BasicDrawer
    v-bind="$attrs"
    :showFooter="false"
    :showOkBtn="false"
    :okAuth="''"
    :maskClosable="true"
    @register="registerDrawer"
    width="80%"
  >
    <template #title>
      <Icon :icon="getTitle.icon" class="pr-1 m-1" />
      <span> {{ getTitle.value }} </span>
    </template>
    <ViewsQuesLibResIndex v-if="quesId" :quesId="quesId" />
  </BasicDrawer>
</template>
<script lang="ts">
  export default defineComponent({
    name: 'ViewsQuesLibResHistoryForm',
  });
</script>
<script lang="ts" setup>
  import { defineComponent, ref, computed } from 'vue';
  import { router } from '/@/router';
  import { BasicDrawer, useDrawerInner } from '/@/components/Drawer';
  import ViewsQuesLibResIndex from './index.vue';

  const getTitle = computed(() => ({
    icon: router.currentRoute.value.meta.icon || 'ant-design:book-outlined',
    value: '历史结果查看',
  }));
  const quesId = ref<string>('');
  const [registerDrawer, { setDrawerProps }] = useDrawerInner(async (data) => {
    setDrawerProps({ loading: true });
    quesId.value = data.quesId;
    console.log(quesId.value);
    setDrawerProps({ loading: false });
  });
</script>
